import request from '@/utils/request'


export function getBanks(params) {
  return request({
    url: '/finance/bank/',
    method: 'GET',
    params
  })
}

export function addBank(bankInfo) {
  return request({
    url: '/finance/bank/',
    method: 'POST',
    data: bankInfo
  })
}

export function updateBank(bankInfo) {
  return request({
    url: `/finance/bank/${bankInfo.id}/`,
    method: 'PATCH',
    data: bankInfo
  })
}

export function delBank(bank_id) {
  return request({
    url: `/finance/bank/${bank_id}/`,
    method: 'DELETE',
  })
}

//初始创建
export function getInitAccount(params) {
  return request({
    url: '/finance/init/',
    method: 'GET',
    params
  })
}

export function addInitAccount(data) {
  return request({
    url: '/finance/init/',
    method: 'POST',
    data
  })
}

export function updateInitAccount(data) {
  return request({
    url: `/finance/init/${data.id}/`,
    method: 'PATCH',
    data
  })
}

export function delInitAccount(data_id) {
  return request({
    url: `/finance/init/${data_id}/`,
    method: 'DELETE',
  })
}

export function initData(data) {
  return request({
    url: '/finance/init/init_data/',
    method: 'POST',
    data
  })
}